﻿@model LabChecker.Models.Task
@{
    ViewBag.Title = string.Format("Edit \"{0}\" of \"{1}\"", Model.Description.Title, Model.Subject.Name);
}

<h2>@Html.ActionLink("Subjects", "Index", "Subject")
    -> @Html.ActionLink(Model.Subject.Name, "Index", "Task", new { subjectId = Model.Subject.Id }, null)
    -> @Model.Description.Title</h2>
<script src="@Url.Content("~/Scripts/tiny_mce/tiny_mce.js")" type="text/javascript"></script>
<script type="text/javascript">
    tinyMCE.init({
        mode: "textareas",
        theme: "advanced",
        theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,help",
        theme_advanced_buttons2: "image,|,bullist,numlist,|,fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword",
        theme_advanced_buttons3: "undo,redo,|,sub,sup,charmap,|,link,unlink,anchor",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        entity_encoding: "raw"
    });
</script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Task</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description.Title)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Description.Title)
            @Html.ValidationMessageFor(model => model.Description.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description.Problem)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description.Problem, 15, 80, null)
            @Html.ValidationMessageFor(model => model.Description.Problem)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description.Input)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description.Input, 15, 80, null)
            @Html.ValidationMessageFor(model => model.Description.Input)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description.Output)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description.Output, 15, 80, null)
            @Html.ValidationMessageFor(model => model.Description.Output)
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
